﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Reflection;

namespace SwiftMVVM.ChangeTracking
{
    /// <summary>
    /// Allows you to get a notification for an object the NotifyChangeMonitor
    /// has found for a given property it wants to monitor and
    /// allows you to determine if you want to monitor it.
    /// </summary>
    internal sealed class VerifyMonitorObjectPropertyEventArgs : CancelEventArgs
    {
        /// <summary>
        /// The object that we're checking
        /// </summary>
        public object SourceObject { get; private set; }

        /// <summary>
        /// The property name
        /// </summary>
        public PropertyInfo PropertyInfo { get; private set; }


        /// <summary>
        /// Constructs a new VerifyMonitorObjectPropertyEventArgs
        /// </summary>
        /// <param name="sourceObject">The source object</param>
        /// <param name="propertyInfo">Information about the property we are interested in monitoring</param>
        public VerifyMonitorObjectPropertyEventArgs(object sourceObject, PropertyInfo propertyInfo)
            : base(false)
        {
            this.SourceObject = sourceObject;
            this.PropertyInfo = propertyInfo;
        }
    }
}
